package security.Roles;

import java.util.Vector;

public abstract class Privilege {

	// identifier comes from checkPoint.checkMe
	public abstract boolean isAllowed(Object[] identifier);

	public abstract void setAllowed(boolean isAllowed);

	public abstract String[] getParams();

	public abstract void setParams(String[] params);

	public abstract String getPrivilegeName();

	public abstract void setPrivilegeName(String privilegeName);

	public abstract String getScope();

	public abstract void setScope(String scope);


	// STATIC METHODS
	// MUST BE OVERWRITTEN BY SUBCLASSES

	
	public static boolean addPrivilege(Privilege p) {		
		throwError();
		return false;
	}
	public static boolean savePrivilege(Privilege p) {
		throwError();
		return false;
	}
	public static boolean delPrivilege(Privilege p) {
		throwError();
		return false;
	}
	public static Vector<Privilege> getPrivileges() {
		throwError();
		return null;
	}
	public static Privilege getPrivilegeByName(String privilegeName) {
		throwError();
		return null;
	}	
	private static void throwError() {
		throw new RuntimeException("Error: use a subclass of Privilege to call this method");
	}		
	
	
	
}
